home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / estat21.zip / GDEMO < prev    next >
Text File  |  1992-07-24  |  9KB  |  369 lines

  1. ; Demo file for EASIGRAF
  2. ; All lines beginning with a ';' will be ignored
  3.  
  4. ; An 'e' at the start of a line is short for 'echo' - the line will be 
  5. ; copied to the output but there will be no other effect
  6. E
  7. E
  8. E                         EASIGRAF - DEMONSTRATION
  9. E Welcome to this demonstration of EASIGRAF. EASIGRAF is a 
  10. E graphics package which graphs data from EASISTAT or other 
  11. E programs. 
  12. E This is a demonstration of how EASISTAT works with EASIGRAF
  13. E to produce graphs of EASISTAT's data. Each time EASISTAT 
  14. E pauses to allow you read a message (as now) you can either 
  15. E press 'E' to finish the demonstration, or 'K' to take 
  16. E temporary control at the keyboard, or any other key to allow
  17. E the demonstration to proceed. If you do press 'K' then when
  18. E you want to return to the demonstration type "INPUT CLOSE".
  19. p
  20. E
  21. E NOTE:
  22. E The demonstration will run MUCH faster from a hard disk than
  23. E a floppy disk, because EASIGRAF will have to be reloaded
  24. E every time a graph is displayed. You may want to quit the 
  25. E demonstration and EASISTAT and copy all the files onto your hard 
  26. E disk if you have not already done so.
  27. E This demonstration assumes that the data from the example file 
  28. E EXAMPLE.DAT has already been loaded into EASISTAT. This will 
  29. E be the case if you have just finished running the EASISTAT 
  30. E demonstration using the command file DEMO. If the data has not 
  31. E been loaded you should do this now according to the following 
  32. E instructions:
  33. p
  34. E First jump to the end of the GDEMO file by pressing E.
  35. E Then read in the EXAMPLE.DAT file by entering a command such 
  36. E as: DATA EXAMPLE.DAT
  37. E If EXAMPLE.DAT is on a different disk then you should insert 
  38. E this disk in the drive and enter (for example): 
  39. E DATA A:EXAMPLE.DAT
  40. E If necessary replace the disk containing (this) GDEMO file and 
  41. E enter: INPUT GDEMO
  42. E
  43. E This demonstration will restart and the example data will be 
  44. E available for it to use.
  45. p
  46. E EASIGRAF and EASISTAT are Shareware programs. If you find 
  47. E them useful then please become a registered user. Details are
  48. E provided in the file READ.ME, or contact:
  49. E   ARC Scientific Limited,
  50. E   257 Woodstock Road,
  51. E   Oxford OX2 7AE.
  52. E   Tel. 0865 310167 
  53. E You will receive up-to-date versions of the programs and a 
  54. E full printed manual. 
  55. E Now we'll start the demonstration.
  56. E We'll start by producing a frequency distribution of HDA,
  57. E a measure of emotional distress. (After all, 
  58. E this program was written by a psychiatrist.)
  59. E To do this we will issue the BASICS command with the G option 
  60. E specified, like this:
  61. E BASICS G HDA
  62. p
  63. BASICS G HDA
  64. E Now the graph file called GRAPH.ME has been written to 
  65. E disk. Next we will run EASIGRAF to display the graph. The 
  66. E only thing you really need to know is how to quit 
  67. E EASIGRAF, which you do by pressing 'Q' when the graph is 
  68. E displayed. Then you will return to this demonstration. 
  69. E Information about the options available in EASIGRAF are 
  70. E described in the manual or on-disk documentation.
  71. E You may wish to hide the menu displayed at the bottom of 
  72. E screen so that you can see the graph properly. To do this 
  73. E press 'M' and to get it back press 'M' again. You may also 
  74. E wish to view this graph as a histogram rather then a line 
  75. E chart. If so press 'V' (for vertical bar chart).
  76. p
  77. E There is one problem which may occur that is difficult to 
  78. E predict, which is that EASIGRAF may fail to correctly 
  79. E recognise your monitor. If this occurs you will have to set 
  80. E a DOS environment variable called FG_DISPLAY. Full 
  81. E instructions for doing this are in the documentaion. If 
  82. E EASIGRAF fails to display a graph and just gives a blank 
  83. E screen or one with "interference" you will need to do this. 
  84. E You will need to quit both EASIGRAF (which may be possible 
  85. E by pressing Q) and EASISTAT, otherwise reboot the computer. 
  86. p
  87. E
  88. E Briefly, try entering one of the following lines (at the DOS 
  89. E prompt) before trying to run this demonstration again: 
  90. E SET FG_DISPLAY=CGAHIRES
  91. E SET FG_DISPLAY=EGAHIRES
  92. E SET FG_DISPLAY=HERC
  93. E SET FG_DISPLAY=VGA11
  94. E depending on whether you have a CGA, EGA, Hercules or VGA 
  95. E monitor.
  96. E
  97. E Press a key (not 'K' or 'E') when you are ready to run 
  98. E EASIGRAF and view the graph.
  99. p
  100. sys easigraf
  101. E Well, you got back here OK. If EASIGRAF didn't work 
  102. E properly then you will need to set FG_DISPLAY and you
  103. E may want to consult the documentaion before continuing
  104. E with this demonstation. If you wish to leave the 
  105. E demonstration press 'E', then type QUIT (ENTER) YES (ENTER).
  106. p
  107. E
  108. E Still here? Good.
  109. E Now let's see a breakdown of GHQ scores (more emotional
  110. E distress) by social class. First we use the ANOVA function
  111. E to provide the data in the correct groups, like this:
  112. E ANOVA G GHQ
  113. E 5
  114. E C5=1
  115. E C5=2
  116. E C5=3
  117. E C5=4
  118. E C5=5
  119. E
  120. E Press a key to continue
  121. p
  122. ANOVA G GHQ
  123. 5
  124. C5=1
  125. C5=2
  126. C5=3
  127. C5=4
  128. C5=5
  129. E
  130. E Now we'll display the graph. To see the means of each group 
  131. E when the graph is showing press 'R', then '3' then ENTER. 
  132. p
  133. sys easigraf
  134. E Next is a histogram of GHQ cases and non-cases (scores less
  135. E than 12) against social class. We use the CHISQ function to
  136. E provide the data:
  137. E CHISQ G
  138. E 2
  139. E 5
  140. E GHQ<12
  141. E GHQ>12
  142. E OCC=1
  143. E OCC=2
  144. E OCC=3
  145. E OCC=4
  146. E C5=5
  147. E
  148. E Press a key to continue
  149. p
  150. CHISQ G
  151. 2
  152. 5
  153. GHQ<12
  154. GHQ>12
  155. OCC=1
  156. OCC=2
  157. OCC=3
  158. OCC=4
  159. OCC=5
  160. E Press a key to view the graph. When it is showing 'X' will 
  161. E swap over the groupings and '3' will make the blocks solid.
  162. system easigraf
  163. E
  164. E And now let's use the Kolmogorov Smirnov statistic to 
  165. E compare the age distributions of the GHQ cases and non-cases.
  166. KOLM G OCC
  167. GHQ<12
  168. GHQ>=12
  169. E
  170. E The graph file contains data about the cumulative 
  171. E frequency of the Age variable in each group, and when the 
  172. E graph is plotted these two frequencies are displayed as the
  173. E default.
  174. p
  175. system easigraf
  176. E
  177. E Now let's try plotting HDA against GHQ. Hopefully they'll 
  178. E correlate fairly well. To provide the graphing data we use 
  179. E the REGRESS function:
  180. E REGRESS G GHQ HDA
  181. REGRESS G GHQ HDA
  182. E To view the regression line when the graph is showing press
  183. E 'R', then '1' then ENTER. 
  184. p
  185. sys easigraf
  186. E To finish the demonstration we'll give examples of how 
  187. E EASISTAT can be used to produce graphs of mathematical 
  188. E functions. We can use the first four columns to hold our 
  189. E variables and there are 100 rows.
  190. E Press a key to continue
  191. p
  192. der c1 0
  193. der c2 0
  194. der c3 0
  195. der c4 0
  196.  
  197. fo c1 8 4
  198. fo c2 6 4
  199. fo c3 6 4
  200. fo c4 8 4
  201. label c1 X
  202. label c2 SIN(X)
  203. label c3 COS(X)
  204. E
  205. E Now we'll use EASISTAT to produce the data to plot trigonometric 
  206. E functions.
  207. der c1 6.283*(row-1)/99
  208.        ; 2PI
  209. der c2 sin(c1)
  210. der c3 cos(c1)
  211. E
  212. E Press a key to continue
  213. p
  214. E
  215. E And then we'll output the data to a graph file using the 
  216. E COMPONENTS function:
  217. co g 3
  218. c1
  219. c2
  220. c3
  221. o graph.me
  222. e DATATYPE:XY1,3
  223. e DATATYPE:XY2,3
  224. o close
  225. E That last bit was clever trick to add more information to 
  226. E the graph file. Press a key to see the graphs (they look 
  227. E good as line graphs, press 'L' when they appear).
  228. p
  229. sys easigraf
  230. E We'll try for a pseudo-3D one now. It's called the frilly 
  231. E circle.
  232. fo c4 8 4
  233. label c4 SIN(8*X)
  234. der c4 sin(c1*8)
  235. co g 3
  236. c2
  237. c4
  238. c3
  239. o graph.me
  240. e MINX:-1.5
  241. e MAXX:1.5
  242. e XINC:1
  243. e MINY:-2
  244. e MAXY:2
  245. e YINC:1
  246. o close
  247. E
  248. E Change it to a line graph first by pressing 'L', then to
  249. E see the third dimension press '3'.
  250. p
  251. sys easigraf
  252. E The equation for that curve was:
  253. E   X=SIN(theta)  Y=SIN(8*theta)  and  Z=COS(theta)
  254. E
  255. E We can use the same data in a different way. 
  256. co g 3
  257. c3
  258. c4
  259. c1
  260. o graph.me
  261. e MINX:-1
  262. e MAXX:2
  263. e XINC:1
  264. e MINY:-1
  265. e MAXY:2.5
  266. e YINC:1
  267. o close
  268. E
  269. E Once again change it to a line graph first by pressing
  270. E 'L', then to see the third dimension press '3'. 
  271. p
  272. sys easigraf
  273. E
  274. E That was:
  275. E  X=COS(theta)  Y=SIN(8*theta)  Z=theta
  276. E
  277. E Now we'll rescale the points and make a helix.
  278. der c1 15*(row-1)/99
  279. der c2 sin(c1)
  280. der c3 cos(c1)
  281. co g 3
  282. c2
  283. c3
  284. c1
  285. o graph.me
  286. e MINX:-1
  287. e MAXX:2
  288. e XINC:1
  289. e MINY:-1.5
  290. e MAXY:3
  291. e YINC:1
  292. o close
  293. E
  294. E Again press 'L' and '3'
  295. sys easigraf
  296. E
  297. E Now here's one of the normal distribution. It involves a 
  298. E bit of number crunching because EASISTAT has to work out 
  299. E some of the probabilities long-hand:
  300. der c1 (row-50)/20
  301. label c2 PHI(X)
  302. der c2 pn(c1)
  303. label c3 p(X)
  304. der c3 exp(0-c1*c1/2)/((3.14159*2) POW 0.5)
  305. co g 3
  306. c1
  307. c2
  308. c3
  309. o graph.me
  310. e DATATYPE:XY1,3
  311. o close
  312. sys easigraf
  313.  
  314. E OK that's all for now.
  315. E The demonstration is finishing, leaving you in control of 
  316. E EASISTAT. To leave EASISTAT type:
  317. E QUIT
  318. E YES
  319. E Please read the manual or documentation files to learn more 
  320. E about EASIGRAF. If you like it then please become a 
  321. E registered user.
  322. E ARC Scientific Limited,
  323. E 257 Woodstock Road,
  324. E Oxford OX2 7AE.
  325.  
  326.